<html>
	<head><title>Win-Loss-Tie Record</title></head>
	<body>
		<center><h1>Regions</h1></center>
		<?php
			echo "<center><h2>Displaying Win-Loss-Tie record for the " . $_POST["region"] . " Region...</h2><br>";
			echo "Region Name: " . $_POST["region"] . "<br>";
			$con = mysql_connect("oniddb.cws.oregonstate.edu","rundej-db","Hp2tYI0CxEY4U9J9");
			if(!$con)
			{
				die('Could not connect: ' . mysql_error());
			}
			mysql_select_db('rundej-db',$con);
			$record = mysql_query("SELECT R.Region_Name, R.Num_Wins,R.Num_Losses,R.Num_Ties FROM Region R WHERE R.Region_Name = '" . $_POST['region']. "';");
			
		?>
			<table border="1">
			<tr>
				<th>Region</th>
				<th>Wins</th>
				<th>Losses</th>
				<th>Ties</th>
			</tr>
		<?php	
			while ($row = mysql_fetch_array($record))
			{
				echo "<tr>";
				echo "<td>" . $row['Region_Name'] . "</td>";
				echo "<td>" . $row['Num_Wins'] . "</td>";
				echo "<td>" . $row['Num_Losses'] . "</td>";
				echo "<td>" . $row['Num_Ties'] . "</td>";
				echo "</tr>";
			}
			mysql_close($con);
		?>
		</table>
		<br>
		<br>
		<br>
		<center>
		<a href = "http://web.engr.oregonstate.edu/~caushikh/cricket-database">Home</a>
		<a href = "http://web.engr.oregonstate.edu/~caushikh/cricket-database/regions.php">Regions</a>
		<a href = "http://web.engr.oregonstate.edu/~caushikh/cricket-database/umpires.php">Umpires</a>
		<a href = "http://web.engr.oregonstate.edu/~caushikh/cricket-database/players.php">Players</a>
		</center>
	</body>
</html>
